Skip to content

feat(api): add HTTP/2 connection keepalive to ClientTrafficPolicy and BackendTrafficPolicy#8215

Open
rajatvig wants to merge 10 commits intoenvoyproxy:mainfrom
rajatvig:feature/http2-keepalive-shared
Open

feat(api): add HTTP/2 connection keepalive to ClientTrafficPolicy and BackendTrafficPolicy#8215
rajatvig wants to merge 10 commits intoenvoyproxy:mainfrom
rajatvig:feature/http2-keepalive-shared

Conversation

@rajatvig
Copy link
Contributor

@rajatvig rajatvig commented Feb 9, 2026

Summary

  • Adds connectionKeepalive field to HTTP2Settings for configuring HTTP/2 PING frames
  • Supports interval, timeout, and connectionIdleInterval settings

Note

The settings are also applied to other resources like EnvoyExtensionPolicy, EnvoyProxy and SecurityPolicy due to how reuse of the HTTP2Settings struct. Trying to make it work just for ClientTrafficPolicy is done in #8213 but extending it for BackendTrafficPolicy is not possible similarly as the struct is embedded in ClusterSettings struct.

This change can be merged independently of the other PR and I can close #8213 if this looks good.

Fixes #7744
Fixes #8214

… BackendTrafficPolicy

Signed-off-by: Rajat Vig <rvig@etsy.com>
@netlify
Copy link

netlify bot commented Feb 9, 2026

Deploy Preview for cerulean-figolla-1f9435 ready!

Name Link
🔨 Latest commit 2569836
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69949b4117e25e0008880d64
😎 Deploy Preview https://deploy-preview-8215--cerulean-figolla-1f9435.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.57%. Comparing base (e56785c) to head (2569836).

Files with missing lines Patch % Lines
internal/gatewayapi/http.go 60.86% 3 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8215      +/-   ##
==========================================
- Coverage   73.57%   73.57%   -0.01%     
==========================================
  Files         242      242              
  Lines       37000    37045      +45     
==========================================
+ Hits        27224    27257      +33     
- Misses       7854     7862       +8     
- Partials     1922     1926       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
@rajatvig rajatvig marked this pull request as ready for review February 9, 2026 01:07
@rajatvig rajatvig requested a review from a team as a code owner February 9, 2026 01:07
Copy link
Member

@zhaohuabing zhaohuabing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to change buildHTTP2Settings in internal/xds/translator/cluster.go to include the keepalive settings for the backend cluster.

if err != nil {
errs = errors.Join(errs, fmt.Errorf("invalid ConnectionKeepalive.Interval: %w", err))
} else {
keepalive.Interval = ptr.To(uint32(d.Seconds()))
Copy link
Member

@zhaohuabing zhaohuabing Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API allows ms, but the translation drops ms, so 1500ms becomes 1s. Should we use metav1.Duration here?

Then envoy api does allows ms: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/protocol.proto#envoy-v3-api-msg-config-core-v3-keepalivesettings

It's fine for TCP keepalive to use seconds only, since the API only allows seconds:
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#config-core-v3-tcpkeepalive

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to support that, we should add our custom type and relax CEL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using metav1.Duration now.

@zhaohuabing
Copy link
Member

Hi @rajatvig it's fine for me to replace #8213 with this pr. Left a few comments. Thanks!

@arkodg arkodg added this to the v1.8.0-rc.1 Release milestone Feb 14, 2026
Signed-off-by: Rajat Vig <rvig@etsy.com>
…live-shared

Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
Signed-off-by: Rajat Vig <rvig@etsy.com>
…live-shared

Signed-off-by: Rajat Vig <rvig@etsy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add HTTP/2 connection keepalive to BackendTrafficPolicy Feature Enhancement: Http2 keep alive probes

3 participants